	<template>
		<!-- 招标信息流程表单 -->
		<view class="container">
			<u-form :model="form" ref="uForm" label-width="200">
			  <u-form-item label="任务名称"
			    ><u-input v-model="form.name" disabled
			  /></u-form-item>
			  <u-form-item label="所属流程"
			    ><u-input v-model="form.belong" disabled
			  /></u-form-item>
			  <u-form-item label="委托人"
			    ><u-input v-model="form.client" disabled
			  /></u-form-item>
			  <u-form-item label="流程发起人"
			    ><u-input v-model="form.initiator" disabled
			  /></u-form-item>
			  <u-form-item label="优先级"
			    ><u-input v-model="form.priority" disabled class="input-color"
			  /></u-form-item>
			  <u-form-item label="状态"
			    ><u-input v-model="form.status" disabled
			  /></u-form-item>
			  <u-form-item label="项目名称"
			    ><u-input v-model="formData.projectName" disabled
			  /></u-form-item>
			  <u-form-item label="代理公司"
			    ><u-input v-model="formData.agencyCompany" disabled
			  /></u-form-item>
			  <u-form-item label="招标业主">
			    <u-input v-model="formData.biddingCustomerName" disabled/>
			  </u-form-item>
			  <u-form-item label="投标公司一">
			    <u-input v-model="formData.bidderName" disabled/>
			  </u-form-item>
			  <u-form-item label="投标金额">
			    <u-input v-model="formData.tenderCount" disabled/>
			  </u-form-item>
			  <u-form-item label="投标公司二">
			    <u-input v-model="formData.bidder1Name" disabled/>
			  </u-form-item>
			  <u-form-item label="投标金额">
			    <u-input v-model="formData.tenderCount1" disabled/>
			  </u-form-item>
			  <u-form-item label="投标公司三">
			    <u-input v-model="formData.bidder2Name" disabled/>
			  </u-form-item>
			  <u-form-item label="投标金额">
			    <u-input v-model="formData.tenderCount2" disabled/>
			  </u-form-item>
			  <u-form-item label="创建时间">
			    <u-input v-model="form.time" disabled />
			  </u-form-item>
			</u-form>
		</view>
	</template>
	
	<script>
		import auditApi from "../../api/audit.js";
		import getNameApi from "../../api/getName.js";
		export default {
			name:"bidding",
			props:['form'],
			data() {
				return {
					formData:{
						projectName:'无',
						agencyCompany:'无',
						biddingCustomerName:'无',
						bidderName:'无',
						bidder1Name:'无',
						bidder2Name:'无',
						tenderCount:0,
						tenderCount1:0,
						tenderCount2:0,
					}
				};
			},
			mounted() {
				setTimeout(()=>{
					this.getData()
				},0)
			},
			methods:{
				async getData(){
					const res1 = await auditApi.getAuditDetail(
						{"X-Access-Token": this.$store.state.token},
						this.form.table)
					let {
					  projectName,
					  agencyCompany,
					  biddingCustomer,
					  bidder,
					  bidder1,
					  bidder2,
					  tenderCount,
					  tenderCount1,
					  tenderCount2
					} = res1.data.result;
					this.formData.projectName = projectName
					this.formData.agencyCompany = agencyCompany
					this.formData.tenderCount = tenderCount
					this.formData.tenderCount1 = tenderCount1
					this.formData.tenderCount2 = tenderCount2
					//通过id查询单位名称
					if(biddingCustomer){
						const res2 = await getNameApi.getCompanyName(
							{
							  "X-Access-Token": this.$store.state.token,
							},
							{id:biddingCustomer}
						  )
						  this.formData.biddingCustomerName = res2.data.result.name || '无'
					}
					if(bidder){
						const res2 = await getNameApi.getCompanyName(
							{
							  "X-Access-Token": this.$store.state.token,
							},
							{id:bidder}
						  )
						  this.formData.bidderName = res2.data.result.name || '无'
					}
					if(bidder1){
						const res2 = await getNameApi.getCompanyName(
							{
							  "X-Access-Token": this.$store.state.token,
							},
							{id:bidder1}
						  )
						  this.formData.bidder1Name = res2.data.result.name || '无'
					}
					if(bidder2){
						const res2 = await getNameApi.getCompanyName(
							{
							  "X-Access-Token": this.$store.state.token,
							},
							{id:bidder2}
						  )
						  this.formData.bidder2Name = res2.data.result.name || '无'
					}
				}
			}
		}
	</script>
	
	<style scoped lang="scss">
	.container {
	  width: 90%;
	  margin: 0 auto;
	}
	</style>